<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1 {
	width: 195px;
}

.select_width {
	width: 130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" style="text-align: center;">
    <col style="width: 16%;"/>
    <col style="width: 42%;"/>
    <col style="width: 42%;"/>
    <tr>
        <td colspan="2">项&nbsp;&nbsp;目</td>
        <td>数&nbsp;&nbsp;额（万元）</td>
    </tr>
    <tr>
        <td rowspan="6">经费来源</td>
        <td>税前从销售额中提取</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status1' id="lyear_trading_volume_status1" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status1"/>' label="经费来源-->税前从销售额中提取">
        </td>
    </tr>
    <tr>
        <td>政府拨款</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status2' id="lyear_trading_volume_status2" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status2"/>' label="经费来源-->政府拨款">
        </td>
    </tr>
    <tr>
        <td>横向合作</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status3' id="lyear_trading_volume_status3" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status3"/>' label="经费来源-->横向合作">
        </td>
    </tr>
    <tr>
        <td>上年度结转</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status4' id="lyear_trading_volume_status4" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status4"/>' label="经费来源-->上年度结转">
        </td>
    </tr>
    <tr>
        <td>其他</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status5' id="lyear_trading_volume_status5" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status5"/>' label="经费来源-->其他">
        </td>
    </tr>
    <tr>
        <td>合计</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status6' id="lyear_trading_volume_status6" class="gray" readonly="readonly" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status6"/>' label="经费来源-->合计">
        </td>
    </tr>
    <tr>
        <td rowspan="6">经费支出</td>
        <td>仪器设备购置</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status11' id="lyear_trading_volume_status11" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status11"/>' label="经费支出-->仪器设备购置">
        </td>
    </tr>
    <tr>
        <td>试验测试费用</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status12' id="lyear_trading_volume_status12" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status12"/>' label="经费支出-->试验测试费用">
        </td>
    </tr>
    <tr>
        <td>购买知识产权</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status13' id="lyear_trading_volume_status13" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status13"/>' label="经费支出-->购买知识产权">
        </td>
    </tr>
    <tr>
        <td>委托研究开发</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status14' id="lyear_trading_volume_status14" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status14"/>' label="经费支出-->委托研究开发">
        </td>
    </tr>
    <tr>
        <td>其他</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status15' id="lyear_trading_volume_status15" class="" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status15"/>' label="经费支出-->其他">
        </td>
    </tr>
    <tr>
        <td>合计</td>
        <td>
            <input type='text' name='proposal/lyear_trading_volume_status16' id="lyear_trading_volume_status16" class="gray" readonly="readonly" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/lyear_trading_volume_status16"/>' label="经费支出-->合计">
        </td>
    </tr>
</table>
<script>
//--------------------计算总数------------------begin
$('#lyear_trading_volume_status1,#lyear_trading_volume_status2,#lyear_trading_volume_status3,#lyear_trading_volume_status4,#lyear_trading_volume_status5').change(function(){
	getTotalCount('lyear_trading_volume_','status1,status2,status3,status4,status5','status6',true);
});
$('#lyear_trading_volume_status11,#lyear_trading_volume_status12,#lyear_trading_volume_status13,#lyear_trading_volume_status14,#lyear_trading_volume_status15').change(function(){
	getTotalCount('lyear_trading_volume_','status11,status12,status13,status14,status15','status16',true);
});
//--------------------计算总数------------------end
/**
----------------------by zk
        参数prefix：公共的id开头
        参数count：需要加的数的id结尾     以,分割
        参数total：总数id结尾
        参数isDeciaml：是否为小数 默认为false
*/
function getTotalCount(prefix,count,total,isDecimal){
  var defaultIsDecimal = false;//默认为整数
  if(isDecimal==null){
        isDecimal = defaultIsDecimal;
  }
  var numStr = count.split(',');
  var totalCount = 0;//总数
  if(!isDecimal){
        for ( var int = 0; int < numStr.length; int++) {
             var num = $('#'+prefix+numStr[int]).val();
             if(!$.isNumeric(num))
                  num = "0";
             totalCount += parseInt(num);
       }
  }else {
     for ( var int = 0; int < numStr.length; int++) {
         var num = $('#'+prefix+numStr[int]).val();
         if(!$.isNumeric(num))
             num = "0";
         totalCount += parseFloat(num);
     }
     totalCount = ((totalCount/100)*100).toFixed(2);
  }
 	
  $('#'+prefix+total).val(totalCount);
}
</script>
